import { observable, action } from 'mobx'
// import * as api from 'lib/constants/api'
// import { post } from 'lib/net'
// import Toast from 'components/toast'

// class AddressModel {
//   constructor (data) {
//     if (data) {
//     }
//   }
// }

export default class PromptVM {
  constructor (props) {
    this.props = props
    this.PageInitialization()
  }

  // 判读页面是显示保存中还是显示提交中
  @observable tipsState = ''

  // 继续添加项目
  @action handleAddProject = () => {
    this.props.history.push('/addProject')
  }

  // 返回项目列表
  @action handleBackProject = () => {
    this.props.history.push('/projectList')
  }

  @action PageInitialization = async () => {
    this.tipsState = this.props.history.location.search.split('?')[1]
    // const UserId = sessionStorage.getItem('userId')
    // let response = await post(api.ADDRESSGETLIST, { UserId: UserId })
    // if (response.Success) {
    //   this.addressLength = response.Value.length
    //   this.addressList = response.Value
    // }
  }
}
